package com.itheima.dao;
import com.itheima.pojo.User;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;
import java.util.Map;


public interface UserMapper extends Mapper<User> {

    /**
     * 根据uid查询user
     * @param uid
     * @return
     */
    @Select("select * from t_user where uid=#{uid}")
    User getUserByUid(@Param("uid") String uid);


    @Select("select user_name userName,pass_word passWord,nick_name nickName,email,login_count loginCount,valid_code validCode,source,last_login_time lastLoginTime,last_login_ip lastLoginIp,comment_status commentStatus,start_email_notification startEmailNotification,os,browser,user_tag userTag,uid,status,create_time createTime,update_time updateTime from t_user where user_name=#{username}")
    Map<String, Object> findVerify(String username);

    @Select("select count(*) from t_user")
    int findUserCount();

}
